<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>viewportsizemonitor.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
  </script>

  <script src="static/js/doc.js">
  </script>

  <meta charset="utf8">
</head>

<body onload="prettyPrint()">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
       <span class="fn">viewportsizemonitor.js</span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    Utility class that monitors viewport size changes.
  </div>
  

        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="../demos/viewportsizemonitor.html">Demo</a></li>
            <li><a href="closure_goog_dom_viewportsizemonitor.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
          </ol>
        </div>
</div>

<h2 class="g-first">File Location</h2>
  <div class="g-section g-tpl-20-80">
    <div class="g-unit g-first">
      <div class="g-c-cell code-label">dom/viewportsizemonitor.js</div>
    </div>
  </div>
<hr/>


  <h2>Classes</h2>
 <div class="fn-constructor">
        <a href="class_goog_dom_ViewportSizeMonitor.html">
          goog.dom.ViewportSizeMonitor</a><br/>
        <div class="class-details">This class can be used to monitor changes in the viewport size.  Instances
dispatch a {@link goog.events.EventType.RESIZE} event when the viewport size
changes.  Handlers can call {@link goog.dom.ViewportSizeMonitor#getSize} to
get the new viewport size.

Use this class if you want to execute resize/reflow logic each time the
user resizes the browser window.  This class is guaranteed to only dispatch
{@code RESIZE} events when the pixel dimensions of the viewport change.
(Internet Explorer fires resize events if any element on the page is resized,
even if the viewport dimensions are unchanged, which can lead to infinite
resize loops.)

Example usage:
<pre class="lang-js">
var vsm = new goog.dom.ViewportSizeMonitor();
goog.events.listen(vsm, goog.events.EventType.RESIZE, function(e) {
alert(&#39;Viewport size changed to &#39; + vsm.getSize());
});
</pre>

Manually verified on IE6, IE7, FF2, Opera 9, and WebKit.  {@code getSize}
doesn&#39;t always return the correct viewport height on Safari 2.0.4.</div>
 </div>
      
<br/>

  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>





  <h2>Global Properties</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.dom.ViewportSizeMonitor.WINDOW_SIZE_POLL_RATE"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.dom.ViewportSizeMonitor.</span><span class="entryName">WINDOW_SIZE_POLL_RATE</span>
        : <div class="fullType"><span class="type"><a href="http://www.google.com/url?sa=D&q=https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span></div>
     </div>


     <div class="entryOverview">
       Rate in milliseconds at which to poll the window size on browsers that
need polling.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_dom_viewportsizemonitor.js.source.html#line87">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>



      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Directory dom</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">File Reference</h2>
            <div id="sideFileIndex" rootPath="closure/goog" current="dom/viewportsizemonitor.js"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
